package domain.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;

@PersistenceCapable
public class Domain implements Serializable{
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@PrimaryKey
	private Key key;
	@Persistent
	private String name;
	@Persistent
	private String title;
	@Persistent
	private ArrayList<String> keywords = new ArrayList<String>();
	@Persistent
	private ArrayList<String> popularKeywords = new ArrayList<String>();
	@Persistent
	private Text description;
	@Persistent
	private int rankAlexa;
	@Persistent
	private int rankGoogle;
	@Persistent
	private int googleIndex;
	@Persistent
	private int yahooIndex;
	@Persistent
	private int bingIndex;
	@Persistent
	private String domainAge;
	@Persistent
	private int googleBackLink;
	@Persistent
	private int yahooBackLink;
	@Persistent
	private int bingBackLink;
	@Persistent
	private String ip;
	@Persistent
	private ArrayList<String> jsLib = new ArrayList<String>();
	@Persistent
	private String programingLanguage;
	@Persistent
	private String webserver;
	@Persistent
	private Date lastUpdateDate;
	@Persistent
	private String googleAnalytic;
	@Persistent
	private String googleAdsense;
	@Persistent
	private String charset;
	@Persistent
	private String visit;
	@Persistent
	private String speed;
	@Persistent
	private String domain;
	@Persistent
	private ArrayList<String> h1 = new ArrayList<String>();
	@Persistent
	private ArrayList<String> h2 = new ArrayList<String>();
	@Persistent
	private ArrayList<String> h3 = new ArrayList<String>();
	@Persistent
	private ArrayList<String> h4 = new ArrayList<String>();
	@Persistent
	private ArrayList<String> h5 = new ArrayList<String>();
	@Persistent
	private ArrayList<String> img = new ArrayList<String>();
	@Persistent
	private int frame;
	@Persistent
	private int sex;
	@Persistent
	private int size;
	@Persistent
	private int robot;
	@Persistent
	private int sitemap;
	@Persistent
	private int metaDesc;
	@Persistent
	private int metaKey;
	@Persistent
	private String field1;
	@Persistent
	private String field2;
	@Persistent
	private String field3;
	@Persistent
	private String field4;
	@Persistent
	private String field5;
	@Persistent
	private Text field6;
	@Persistent
	private Text field7;
	@Persistent
	private int field8;
	@Persistent
	private int field9;
	@Persistent
	private Text field10;
	@Persistent
	private int showsite;
	@Persistent
	private ArrayList<String> flash = new ArrayList<String>();
	public int getShowsite() {
		return showsite;
	}
	public void setShowsite(int showsite) {
		this.showsite = showsite;
	}
	public String getField1() {
		return field1;
	}
	public void setField1(String field1) {
		this.field1 = field1;
	}
	public String getField2() {
		return field2;
	}
	public void setField2(String field2) {
		this.field2 = field2;
	}
	public String getField3() {
		return field3;
	}
	public void setField3(String field3) {
		this.field3 = field3;
	}
	public String getField4() {
		return field4;
	}
	public void setField4(String field4) {
		this.field4 = field4;
	}
	public String getField5() {
		return field5;
	}
	public void setField5(String field5) {
		this.field5 = field5;
	}
	public Text getField6() {
		return field6;
	}
	public void setField6(Text field6) {
		this.field6 = field6;
	}
	public Text getField7() {
		return field7;
	}
	public void setField7(Text field7) {
		this.field7 = field7;
	}
	public int getField8() {
		return field8;
	}
	public void setField8(int field8) {
		this.field8 = field8;
	}
	public int getField9() {
		return field9;
	}
	public void setField9(int field9) {
		this.field9 = field9;
	}
	public Text getField10() {
		return field10;
	}
	public void setField10(Text field10) {
		this.field10 = field10;
	}
	public int getMetaDesc() {
		return metaDesc;
	}
	public void setMetaDesc(int metaDesc) {
		this.metaDesc = metaDesc;
	}
	public int getMetaKey() {
		return metaKey;
	}
	public void setMetaKey(int metaKey) {
		this.metaKey = metaKey;
	}
	public int getRobot() {
		return robot;
	}
	public void setRobot(int robot) {
		this.robot = robot;
	}
	public int getSitemap() {
		return sitemap;
	}
	public void setSitemap(int sitemap) {
		this.sitemap = sitemap;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public int getSex() {
		return sex;
	}
	public void setSex(int sex) {
		this.sex = sex;
	}
	public String getDomain() {
		return domain;
	}
	public void setDomain(String domain) {
		this.domain = domain;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getSpeed() {
		return speed;
	}
	public void setSpeed(String speed) {
		this.speed = speed;
	}
	public String getVisit() {
		return visit;
	}
	public void setVisit(String visit) {
		this.visit = visit;
	}
	public String getCharset() {
		return charset;
	}
	public void setCharset(String charset) {
		this.charset = charset;
	}
	public void addH1(String h)
	{
		if(!this.h1.contains(h))
			this.h1.add(h);
	}
	public void addH2(String h)
	{
		if(!this.h2.contains(h))
			this.h2.add(h);
	}
	public void addH3(String h)
	{
		if(!this.h3.contains(h))
			this.h3.add(h);
	}
	public void addH4(String h)
	{
		if(!this.h4.contains(h))
			this.h4.add(h);
	}
	public void addH5(String h)
	{
		if(!this.h5.contains(h))
			this.h5.add(h);
	}
	public void addImg(String img)
	{
		if(!this.img.contains(img))
			this.img.add(img);
	}
	public void addFlash(String flash)
	{
		if(!this.flash.contains(flash))
			this.flash.add(flash);
	}
	public ArrayList<String> getH1() {
		return h1;
	}
	public void setH1(ArrayList<String> h1) {
		this.h1 = h1;
	}
	public ArrayList<String> getH2() {
		return h2;
	}
	public void setH2(ArrayList<String> h2) {
		this.h2 = h2;
	}
	public ArrayList<String> getH3() {
		return h3;
	}
	public void setH3(ArrayList<String> h3) {
		this.h3 = h3;
	}
	public ArrayList<String> getH4() {
		return h4;
	}
	public void setH4(ArrayList<String> h4) {
		this.h4 = h4;
	}
	public ArrayList<String> getH5() {
		return h5;
	}
	public void setH5(ArrayList<String> h5) {
		this.h5 = h5;
	}
	public ArrayList<String> getImg() {
		return img;
	}
	public void setImg(ArrayList<String> img) {
		this.img = img;
	}
	public int getFrame() {
		return frame;
	}
	public void setFrame(int frame) {
		this.frame = frame;
	}
	public ArrayList<String> getFlash() {
		return flash;
	}
	public void setFlash(ArrayList<String> flash) {
		this.flash = flash;
	}
	public String getGoogleAnalytic() {
		return googleAnalytic;
	}
	public void setGoogleAnalytic(String googleAnalytic) {
		this.googleAnalytic = googleAnalytic;
	}
	public String getGoogleAdsense() {
		return googleAdsense;
	}
	public void setGoogleAdsense(String googleAdsense) {
		this.googleAdsense = googleAdsense;
	}
	public void addJsLib(String js)
	{
		if(!this.jsLib.contains(js))
			this.jsLib.add(js);
	}
	public void addKeywords(String keywords)
	{
		if(!this.keywords.contains(keywords))
			this.keywords.add(keywords);
	}
	public void addPopularKeywords(String keywords)
	{
		if(!this.popularKeywords.contains(keywords))
			this.popularKeywords.add(keywords);
	}
	public Key getKey() {
		return key;
	}
	public void setKey(Key key) {
		this.key = key;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public ArrayList<String> getKeywords() {
		return keywords;
	}
	public void setKeywords(ArrayList<String> keywords) {
		this.keywords = keywords;
	}
	public ArrayList<String> getPopularKeywords() {
		return popularKeywords;
	}
	public void setPopularKeywords(ArrayList<String> popularKeywords) {
		this.popularKeywords = popularKeywords;
	}
	public Text getDescription() {
		return description;
	}
	public void setDescription(Text description) {
		this.description = description;
	}
	public int getRankAlexa() {
		return rankAlexa;
	}
	public void setRankAlexa(int rankAlexa) {
		this.rankAlexa = rankAlexa;
	}
	public int getRankGoogle() {
		return rankGoogle;
	}
	public void setRankGoogle(int rankGoogle) {
		this.rankGoogle = rankGoogle;
	}
	public int getGoogleIndex() {
		return googleIndex;
	}
	public void setGoogleIndex(int googleIndex) {
		this.googleIndex = googleIndex;
	}
	public int getYahooIndex() {
		return yahooIndex;
	}
	public void setYahooIndex(int yahooIndex) {
		this.yahooIndex = yahooIndex;
	}
	public int getBingIndex() {
		return bingIndex;
	}
	public void setBingIndex(int bingIndex) {
		this.bingIndex = bingIndex;
	}
	public String getDomainAge() {
		return domainAge;
	}
	public void setDomainAge(String domainAge) {
		this.domainAge = domainAge;
	}
	public int getGoogleBackLink() {
		return googleBackLink;
	}
	public void setGoogleBackLink(int googleBackLink) {
		this.googleBackLink = googleBackLink;
	}
	public int getYahooBackLink() {
		return yahooBackLink;
	}
	public void setYahooBackLink(int yahooBackLink) {
		this.yahooBackLink = yahooBackLink;
	}
	public int getBingBackLink() {
		return bingBackLink;
	}
	public void setBingBackLink(int bingBackLink) {
		this.bingBackLink = bingBackLink;
	}
	public ArrayList<String> getJsLib() {
		return jsLib;
	}
	public void setJsLib(ArrayList<String> jsLib) {
		this.jsLib = jsLib;
	}
	public String getProgramingLanguage() {
		return programingLanguage;
	}
	public void setProgramingLanguage(String programingLanguage) {
		this.programingLanguage = programingLanguage;
	}
	public String getWebserver() {
		return webserver;
	}
	public void setWebserver(String webserver) {
		this.webserver = webserver;
	}
	public Date getLastUpdateDate() {
		return lastUpdateDate;
	}
	public void setLastUpdateDate(Date lastUpdateDate) {
		this.lastUpdateDate = lastUpdateDate;
	}
	public String getKeywordString()
	{
		String str="";
		for(String jString : this.getKeywords())
		{
			str+="<a href='/keyword/"+jString+"' title='"+jString+"'>"+jString+"</a>"+" , ";
			
		}
		return str;
	}
	public String getPopularKeywordString()
	{
		String str="";
		for(String jString : this.getPopularKeywords())
		{
			str+="<a href='/keyword/"+jString+"' title='"+jString+"'>"+jString+"</a>"+" , ";
			
		}
		return str;
	}
	public String getPopularKeywordToString()
	{
		String str="";
		for(String jString : this.getPopularKeywords())
		{
			str+=jString+",";
			
		}
		return str;
	}
	public String getKeywordToString()
	{
		String str="";
		for(String jString : this.getKeywords())
		{
			str+=jString+",";
			
		}
		return str;
	}
	public String getJsString()
	{
		String str="";
		for(String jString : this.getJsLib())
		{
			str+=jString+" , ";
			
		}
		return str;
	}
}
